package com.taotao.chatbot.controller;


import com.taotao.chatbot.domain.po.MedDisease;
import com.taotao.chatbot.domain.po.MedPart;
import com.taotao.chatbot.domain.vo.MidDocDisVo;

import com.taotao.chatbot.service.impl.MedDepartmentServiceImpl;
import com.taotao.common.core.domain.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.taotao.common.core.web.controller.BaseController;

import java.util.List;

/**
 * 器官选择Controller
 *
 * @author zt
 * @date 2025-03-02
 */
@RestController
@RequestMapping("/chatbot")
public class MedDepartmentController extends BaseController
{
    @Autowired
    private MedDepartmentServiceImpl medPartService;

    /**
     * 查询身体部位列表
     * @return
     */
    @GetMapping("/list")
    public Result partList() {
        List<MedPart> partList = medPartService.partList();
        return Result.success(partList);
    }
    /**
     * 根据身体部位id查询常见病
     */
    @GetMapping("/findByIdDisease/{id}")
    public List<MedDisease> findByIdDisease(@PathVariable("id") Integer id) {
        List<MedDisease> part = medPartService.findByIdDisease(id);
        return part;
    }
    /**
     * 根据选中的常见病查询医生列表
     */
    @GetMapping("/findDoctorByDisease/{diseaseId}")
    public Result findDoctorByDisease(@PathVariable("diseaseId") Integer diseaseId) {
        List<MidDocDisVo> doctorList = medPartService.findDoctorByDisease(diseaseId);
        return Result.success(doctorList);
    }
}
